home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume20 / parseargs / patch06 next >
Encoding:
Text File  |  1991-06-08  |  53.7 KB  |  1,605 lines

  1. Newsgroups: comp.sources.misc
  2. From: Brad Appleton <brad@hcx1.ssd.csd.harris.com>
  3. Subject:  v20i046:  parseargs - functions to parse command line arguments, Patch06
  4. Message-ID: <1991Jun8.020907.22383@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 804fc977204fa879cddb0f9effb807bb
  6. Date: Sat, 8 Jun 1991 02:09:07 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Brad Appleton <brad@hcx1.ssd.csd.harris.com>
  10. Posting-number: Volume 20, Issue 46
  11. Archive-name: parseargs/patch06
  12. Environment: UNIX, VMS, MS-DOS, OS/2, Amiga
  13. Patch-To: parseargs: Volume 17, Issue 46-57
  14.  
  15. This is patch06 for parseargs. Its includes the following changes:
  16.  
  17.     - parsecntl(3) now correctly handles mispelled keywords for the
  18.       pc_ARGFLAGS request (it was looping forever).
  19.     - fixed an error in the documentation (a "NOT" was omitted).
  20.     - added #ifdef SVR4 stuff to unix_man.c to print System V Release 4
  21.       style manual pages.
  22.     - allowed "sname=aname" syntax in the ad_prompt field of an ARGDESC
  23.       in addition to the existing syntax. This new syntax allows argument
  24.       names to be be completely different from keyword names.
  25.     - changed get_name() & get_keyword to get_argname() & get_kwdname()
  26.       (respectively) in strfuncs.[ch]. Also sped up the algorithm to get
  27.       the keyword (since it no longer needs malloc).
  28.  
  29. This patch consists of the file PATCH which is a set of context diffs to 
  30. be fed to the patch program.
  31.  
  32. To apply this patch:
  33.  
  34.    1) cd to the directory containing the source for parseargs,
  35.    2) unshar this archive,
  36.    4) type "patch -p0 < PATCH" to apply the patches
  37.  
  38. ______________________ "And miles to go before I sleep." ______________________
  39.  Brad Appleton           brad@ssd.csd.harris.com       Harris Computer Systems
  40.                              uunet!hcx1!brad           Fort Lauderdale, FL USA
  41. ~~~~~~~~~~~~~~~~~~~~ Disclaimer: I said it, not my company! ~~~~~~~~~~~~~~~~~~~
  42.  
  43. #! /bin/sh
  44. # This is a shell archive.  Remove anything before this line, then feed it
  45. # into a shell via "sh file" or similar.  To overwrite existing files,
  46. # type "sh file -c".
  47. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  48. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  49. # Contents:  PATCH
  50. # Wrapped by kent@sparky on Fri Jun  7 20:53:09 1991
  51. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  52. echo If this archive is complete, you will see the following message:
  53. echo '          "shar: End of archive."'
  54. if test -f 'PATCH' -a "${1}" != "-c" ; then 
  55.   echo shar: Will not clobber existing file \"'PATCH'\"
  56. else
  57.   echo shar: Extracting \"'PATCH'\" \(50339 characters\)
  58.   sed "s/^X//" >'PATCH' <<'END_OF_FILE'
  59. X*** Intro.OLD    Mon Jun  3 11:13:52 1991
  60. X--- Intro    Wed May 22 14:47:07 1991
  61. X***************
  62. X*** 83,89 ****
  63. X  
  64. X   And before you know it, your command-line had been parsed, all variables 
  65. X   have been assigned their corresponding values from the command-line, syntax
  66. X!  has been verified, and a usage message (if required) has been printed. 
  67. X  
  68. X   Under UNIX, the command-line syntax (using single character options) for the
  69. X   above command would be:
  70. X--- 83,89 ----
  71. X  
  72. X   And before you know it, your command-line had been parsed, all variables 
  73. X   have been assigned their corresponding values from the command-line, syntax
  74. X!  have been verified, and a usage message (if required) has been printed. 
  75. X  
  76. X   Under UNIX, the command-line syntax (using single character options) for the
  77. X   above command would be:
  78. X***************
  79. X*** 108,114 ****
  80. X      cmdname [/a[=<areacode>]] [/g=<newsgroups>...] [/r=<repcount>]
  81. X              [/s=<sepchar>] [/x]  <name>  [<args>...]
  82. X  
  83. X!   The AmigaDOS command-line syntax would be the following:
  84. X  
  85. X      cmdname [AREA [<areacode>]] [GROUPS <newsgroups>...] [REP <repcount>]
  86. X              [SEP <sepchar>] [X]  <name>  [<args>...]
  87. X--- 108,114 ----
  88. X      cmdname [/a[=<areacode>]] [/g=<newsgroups>...] [/r=<repcount>]
  89. X              [/s=<sepchar>] [/x]  <name>  [<args>...]
  90. X  
  91. X!  The AmigaDOS command-line syntax would be the following:
  92. X  
  93. X      cmdname [AREA [<areacode>]] [GROUPS <newsgroups>...] [REP <repcount>]
  94. X              [SEP <sepchar>] [X]  <name>  [<args>...]
  95. X*** README.OLD    Mon Jun  3 11:14:12 1991
  96. X--- README    Wed May 22 14:56:09 1991
  97. X***************
  98. X*** 290,295 ****
  99. X--- 290,296 ----
  100. X   I also added the capability to handle ARGVEC arguments into the
  101. X   remaining argument type functions.
  102. X  
  103. X+ 
  104. X   NEW ARGUMENT FLAGS:
  105. X   ===================
  106. X   I added the following argument flags to parseargs:
  107. X***************
  108. X*** 306,311 ****
  109. X--- 307,313 ----
  110. X  
  111. X   Consult the manual page for parseargs(1) & parseargs(3) for more information.
  112. X  
  113. X+ 
  114. X   NEW INTERFACE
  115. X   =============
  116. X   I added a set of Macros to allow a more "self documenting" approach to
  117. X***************
  118. X*** 336,341 ****
  119. X--- 338,344 ----
  120. X   variable.  See the parseargs(3) and parseargs(1) manual pages for more
  121. X   information regarding USAGECNTL.
  122. X  
  123. X+ 
  124. X   SPECIFYING ALTERNATE PARSING BEHAVIOR
  125. X   =====================================
  126. X   Parseargs provides 3 methods for controlling "how" the command-line is
  127. X***************
  128. X*** 351,356 ****
  129. X--- 354,360 ----
  130. X   See the manual pages for parseargs(1), parseargs(3), and parsecntl(3)
  131. X   for more information.
  132. X  
  133. X+ 
  134. X   GIVING DEFAULT ARGUMENTS
  135. X   ========================
  136. X   Programs that use parseargs may be given default arguments under UNIX
  137. X***************
  138. X*** 379,389 ****
  139. X   relatively easy to add new shell-types. At this point in time, parseargs
  140. X   will generate output for the following command-interpreters:
  141. X  
  142. X!      sh           (Bourne Shell)
  143. X!      csh/tcsh     (C-Shell)
  144. X!      bash         (Bourne-Again Shell)
  145. X!      ksh          (Korn Shell)
  146. X!      rc           (Plan 9 Shell)
  147. X       perl
  148. X       awk
  149. X  
  150. X--- 383,394 ----
  151. X   relatively easy to add new shell-types. At this point in time, parseargs
  152. X   will generate output for the following command-interpreters:
  153. X  
  154. X!      sh               (Bourne Shell)
  155. X!      csh/tcsh/itcsh   (C-Shell)
  156. X!      bash             (Bourne-Again Shell)
  157. X!      ksh              (Korn Shell)
  158. X!      rc               (Plan 9 Shell)
  159. X!      zsh              (Z shell)
  160. X       perl
  161. X       awk
  162. X  
  163. X*** amiga_args.c.OLD    Mon Jun  3 11:14:17 1991
  164. X--- amiga_args.c    Mon May 13 13:44:24 1991
  165. X***************
  166. X*** 144,150 ****
  167. X                 BSET( arg_flags(cmd_prev(cmd)), ARGGIVEN );
  168. X              }
  169. X              else {  /* value was required */
  170. X!                (VOID)get_keyword( arg_sname(cmd_prev(cmd)), keyword );
  171. X                 usrerr( "value required for %s keyword", keyword );
  172. X                 parse_error = pe_SYNTAX;
  173. X              }
  174. X--- 144,150 ----
  175. X                 BSET( arg_flags(cmd_prev(cmd)), ARGGIVEN );
  176. X              }
  177. X              else {  /* value was required */
  178. X!                (VOID)get_kwdname( arg_sname(cmd_prev(cmd)), keyword );
  179. X                 usrerr( "value required for %s keyword", keyword );
  180. X                 parse_error = pe_SYNTAX;
  181. X              }
  182. X***************
  183. X*** 310,316 ****
  184. X           BSET( arg_flags(cmd_prev(cmd)), ARGGIVEN );
  185. X        }
  186. X        else {  /* value was required */
  187. X!          (VOID)get_keyword( arg_sname(cmd_prev(cmd)), keyword );
  188. X           usrerr( "value required for %s keyword", keyword );
  189. X           parse_error = pe_SYNTAX;
  190. X        }
  191. X--- 310,316 ----
  192. X           BSET( arg_flags(cmd_prev(cmd)), ARGGIVEN );
  193. X        }
  194. X        else {  /* value was required */
  195. X!          (VOID)get_kwdname( arg_sname(cmd_prev(cmd)), keyword );
  196. X           usrerr( "value required for %s keyword", keyword );
  197. X           parse_error = pe_SYNTAX;
  198. X        }
  199. X***************
  200. X*** 366,378 ****
  201. X     char * pos;
  202. X     argName_t  keyword, name;
  203. X  
  204. X!    (VOID) get_name(arg_sname(ad), name);
  205. X  
  206. X     if ( ARG_isPOSITIONAL(ad) ) {
  207. X        sprintf( buf, "<%s>", name );
  208. X     }
  209. X     else {
  210. X!       (VOID) get_keyword(arg_sname(ad), keyword);
  211. X        (VOID) strcpy( buf, keyword );
  212. X        pos = buf + strlen(buf);
  213. X  
  214. X--- 366,378 ----
  215. X     char * pos;
  216. X     argName_t  keyword, name;
  217. X  
  218. X!    (VOID) get_argname(arg_sname(ad), name);
  219. X  
  220. X     if ( ARG_isPOSITIONAL(ad) ) {
  221. X        sprintf( buf, "<%s>", name );
  222. X     }
  223. X     else {
  224. X!       (VOID) get_kwdname(arg_sname(ad), keyword);
  225. X        (VOID) strcpy( buf, keyword );
  226. X        pos = buf + strlen(buf);
  227. X  
  228. X*** arglist.c.OLD    Mon Jun  3 11:14:22 1991
  229. X--- arglist.c    Mon May 13 13:44:24 1991
  230. X***************
  231. X*** 94,100 ****
  232. X     ArgListHead *nl;
  233. X     ArgList *nd;
  234. X  
  235. X!    (VOID) get_name( arg_sname(ad), argname );
  236. X     if (copyf) {
  237. X        register int i;
  238. X  
  239. X--- 94,100 ----
  240. X     ArgListHead *nl;
  241. X     ArgList *nd;
  242. X  
  243. X!    (VOID) get_argname( arg_sname(ad), argname );
  244. X     if (copyf) {
  245. X        register int i;
  246. X  
  247. X*** argtype.c.OLD    Mon Jun  3 11:14:26 1991
  248. X--- argtype.c    Mon May 13 13:44:25 1991
  249. X***************
  250. X*** 202,208 ****
  251. X     char *cp;
  252. X     argName_t  argname;
  253. X  
  254. X!    (VOID) get_name( arg_sname(ad), argname );
  255. X     if (copyf) {
  256. X        register int i;
  257. X  
  258. X--- 202,208 ----
  259. X     char *cp;
  260. X     argName_t  argname;
  261. X  
  262. X!    (VOID) get_argname( arg_sname(ad), argname );
  263. X     if (copyf) {
  264. X        register int i;
  265. X  
  266. X***************
  267. X*** 270,276 ****
  268. X     int status = FALSE;
  269. X     char c;
  270. X  
  271. X!    (VOID) get_name( arg_sname(ad), argname );
  272. X     if (!vp || !*vp) {
  273. X        status = FALSE;
  274. X     }
  275. X--- 270,276 ----
  276. X     int status = FALSE;
  277. X     char c;
  278. X  
  279. X!    (VOID) get_argname( arg_sname(ad), argname );
  280. X     if (!vp || !*vp) {
  281. X        status = FALSE;
  282. X     }
  283. X***************
  284. X*** 340,346 ****
  285. X     argName_t  argname; \
  286. X     num_t  value; \
  287. X   \
  288. X!    (VOID) get_name( arg_sname(ad), argname ); \
  289. X     value = (num_t) strtol(vp, &vpp, 0); \
  290. X     if (*vpp != '\0') { \
  291. X        usrerr("invalid integer argument '%s' for %s", vp, argname); \
  292. X--- 340,346 ----
  293. X     argName_t  argname; \
  294. X     num_t  value; \
  295. X   \
  296. X!    (VOID) get_argname( arg_sname(ad), argname ); \
  297. X     value = (num_t) strtol(vp, &vpp, 0); \
  298. X     if (*vpp != '\0') { \
  299. X        usrerr("invalid integer argument '%s' for %s", vp, argname); \
  300. X***************
  301. X*** 401,407 ****
  302. X     argName_t  argname; \
  303. X     dec_t  value; \
  304. X   \
  305. X!    (VOID) get_name( arg_sname(ad), argname ); \
  306. X     value = (dec_t) strtod(vp, &vpp); \
  307. X     if (*vpp != '\0') { \
  308. X        usrerr("invalid decimal argument '%s' for %s", vp, argname); \
  309. X--- 401,407 ----
  310. X     argName_t  argname; \
  311. X     dec_t  value; \
  312. X   \
  313. X!    (VOID) get_argname( arg_sname(ad), argname ); \
  314. X     value = (dec_t) strtod(vp, &vpp); \
  315. X     if (*vpp != '\0') { \
  316. X        usrerr("invalid decimal argument '%s' for %s", vp, argname); \
  317. X***************
  318. X*** 504,510 ****
  319. X     argName_t  argname;
  320. X     int len;
  321. X  
  322. X!    (VOID) get_name( arg_sname(ad), argname );
  323. X  
  324. X     /* ARGVECs are not supported for this Boolean arg-types */
  325. X     if ( ARG_isVEC(ad) )
  326. X--- 504,510 ----
  327. X     argName_t  argname;
  328. X     int len;
  329. X  
  330. X!    (VOID) get_argname( arg_sname(ad), argname );
  331. X  
  332. X     /* ARGVECs are not supported for this Boolean arg-types */
  333. X     if ( ARG_isVEC(ad) )
  334. X***************
  335. X*** 574,580 ****
  336. X     argName_t  argname;
  337. X     BOOL  retval;
  338. X  
  339. X!    (VOID) get_name( arg_sname(ad), argname );
  340. X  
  341. X     /* ARGVECs are not supported for this Boolean arg-types */
  342. X     if ( ARG_isVEC(ad) )
  343. X--- 574,580 ----
  344. X     argName_t  argname;
  345. X     BOOL  retval;
  346. X  
  347. X!    (VOID) get_argname( arg_sname(ad), argname );
  348. X  
  349. X     /* ARGVECs are not supported for this Boolean arg-types */
  350. X     if ( ARG_isVEC(ad) )
  351. X***************
  352. X*** 596,602 ****
  353. X     argName_t  argname;
  354. X     BOOL  retval;
  355. X  
  356. X!    (VOID) get_name( arg_sname(ad), argname );
  357. X  
  358. X     /* ARGVECs are not supported for this Boolean arg-types */
  359. X     if ( ARG_isVEC(ad) )
  360. X--- 596,602 ----
  361. X     argName_t  argname;
  362. X     BOOL  retval;
  363. X  
  364. X!    (VOID) get_argname( arg_sname(ad), argname );
  365. X  
  366. X     /* ARGVECs are not supported for this Boolean arg-types */
  367. X     if ( ARG_isVEC(ad) )
  368. X***************
  369. X*** 618,624 ****
  370. X     argName_t  argname;
  371. X     BOOL  retval;
  372. X  
  373. X!    (VOID) get_name( arg_sname(ad), argname );
  374. X  
  375. X     /* ARGVECs are not supported for this Boolean arg-types */
  376. X     if ( ARG_isVEC(ad) )
  377. X--- 618,624 ----
  378. X     argName_t  argname;
  379. X     BOOL  retval;
  380. X  
  381. X!    (VOID) get_argname( arg_sname(ad), argname );
  382. X  
  383. X     /* ARGVECs are not supported for this Boolean arg-types */
  384. X     if ( ARG_isVEC(ad) )
  385. X*** doc/Makefile.OLD    Mon Jun  3 11:14:32 1991
  386. X--- doc/Makefile    Tue May 14 14:38:21 1991
  387. X***************
  388. X*** 144,150 ****
  389. X  clobber: clean
  390. X      ${DEL} *.txt
  391. X  
  392. X! spell: ${INCS} ${SRCS}}
  393. X      ${SPELL} ${SPELLFLAGS} ${INCS} ${SRCS}
  394. X  
  395. X  print: ${MANFILES} ${INCS}
  396. X--- 144,150 ----
  397. X  clobber: clean
  398. X      ${DEL} *.txt
  399. X  
  400. X! spell: ${INCS} ${SRCS}
  401. X      ${SPELL} ${SPELLFLAGS} ${INCS} ${SRCS}
  402. X  
  403. X  print: ${MANFILES} ${INCS}
  404. X*** doc/argdesc.inc.OLD    Mon Jun  3 11:14:40 1991
  405. X--- doc/argdesc.inc    Sat May 11 12:17:40 1991
  406. X***************
  407. X*** 49,57 ****
  408. X  description (the description must be separated from the long-name by
  409. X  at least one whitespace character and may optionally be enclosed in
  410. X  a set of balanced delimiters (such as parentheses, curly-braces,
  411. X! square-brackets, or angle-brackets). If the long-name contains any
  412. X  uppercase characters, then the substring of long-name consisting of
  413. X! all uppercase characters is used as the argument keyword and the entire
  414. X! long-name is used as the name of the argument (if a value may be
  415. X! supplied). The long-name may be matched by supplying a unique prefix
  416. X! of either the argument keyword or the argument name.
  417. X--- 49,63 ----
  418. X  description (the description must be separated from the long-name by
  419. X  at least one whitespace character and may optionally be enclosed in
  420. X  a set of balanced delimiters (such as parentheses, curly-braces,
  421. X! square-brackets, or angle-brackets). The longname may be specifed
  422. X! in two parts: a keyword name and an argument name. The argument
  423. X! name may be separated from the keyword name by a single equal sign
  424. X! (`='). No whitespace is allowed before or after the equal sign.
  425. X! 
  426. X! Alternatatively, the keyword name may be distinguished from the
  427. X! argument name by character case: if the long-name contains any
  428. X  uppercase characters, then the substring of long-name consisting of
  429. X! all uppercase characters is used as the argument keyword and the
  430. X! entire long-name is used as the name of the argument (if a value may
  431. X! be supplied). The long-name may be matched by supplying a unique
  432. X! prefix of either the argument keyword or the argument name.
  433. X*** doc/parseargs.man1.OLD    Mon Jun  3 11:15:49 1991
  434. X--- doc/parseargs.man1    Sat May 11 12:20:43 1991
  435. X***************
  436. X*** 158,163 ****
  437. X--- 158,176 ----
  438. X  and printed in usage messages. This string may be followed by a
  439. X  textual description that is enclosed in parentheses, square brackets,
  440. X  curly braces, or angle brackets.
  441. X+ 
  442. X+ The prompt-string may be specifed
  443. X+ in two parts: a keyword name and an argument name. The argument
  444. X+ name may be separated from the keyword name by a single equal sign
  445. X+ ('='). No whitespace is allowed before or after the equal sign.
  446. X+ 
  447. X+ Alternatatively, the keyword name may be distinguished from the
  448. X+ argument name by character case: if the long-name contains any
  449. X+ uppercase characters, then the substring of long-name consisting of
  450. X+ all uppercase characters is used as the argument keyword and the
  451. X+ entire long-name is used as the name of the argument (if a value may
  452. X+ be supplied). The long-name may be matched by supplying a unique
  453. X+ prefix of either the argument keyword or the argument name.
  454. X  .PP
  455. X  The argument specification string must be terminated by the single string:
  456. X  ``ENDOFARGS''.
  457. X*** doc/returns.inc.OLD    Mon Jun  3 11:16:33 1991
  458. X--- doc/returns.inc    Mon May 20 17:36:20 1991
  459. X***************
  460. X*** 28,35 ****
  461. X  .IP "\fIpe_\s-1NOMATCH\s+1\fP"
  462. X  Unable to match the named argument. This occurs
  463. X  when the argument keyword name passed to \fIparsecntl\fP (using the 
  464. X! \fIpc_\s-1ARGFLAGS\s+1\fP functions code) was found in the given argdesc-array
  465. X! or in its default-list.
  466. X  .\"---------------------------------------------
  467. X  .IP "\fIpe_\s-1BADMODE\s+1\fP"
  468. X  Bad mode for given command in \fIparsecntl\fP. This occurs when 
  469. X--- 28,35 ----
  470. X  .IP "\fIpe_\s-1NOMATCH\s+1\fP"
  471. X  Unable to match the named argument. This occurs
  472. X  when the argument keyword name passed to \fIparsecntl\fP (using the 
  473. X! \fIpc_\s-1ARGFLAGS\s+1\fP functions code) was NOT found in the given
  474. X! argdesc-array or in its default-list.
  475. X  .\"---------------------------------------------
  476. X  .IP "\fIpe_\s-1BADMODE\s+1\fP"
  477. X  Bad mode for given command in \fIparsecntl\fP. This occurs when 
  478. X*** ibm_args.c.OLD    Mon Jun  3 11:17:03 1991
  479. X--- ibm_args.c    Mon May 13 13:44:26 1991
  480. X***************
  481. X*** 301,307 ****
  482. X                    BSET( arg_flags(ad), ARGGIVEN );
  483. X                 }
  484. X                 else {
  485. X!                   (VOID) get_keyword( arg_sname(ad), name );
  486. X                    usrerr("%c%s switch requires an argument", KwdPrefix, name);
  487. X                    arg_flags(ad) = flags;
  488. X                    parse_error = pe_SYNTAX;
  489. X--- 301,307 ----
  490. X                    BSET( arg_flags(ad), ARGGIVEN );
  491. X                 }
  492. X                 else {
  493. X!                   (VOID) get_kwdname( arg_sname(ad), name );
  494. X                    usrerr("%c%s switch requires an argument", KwdPrefix, name);
  495. X                    arg_flags(ad) = flags;
  496. X                    parse_error = pe_SYNTAX;
  497. X***************
  498. X*** 429,435 ****
  499. X                       BSET( arg_flags(ad), ARGGIVEN );
  500. X                    }
  501. X                    else {
  502. X!                      (VOID) get_name(arg_sname(ad), name);
  503. X                       usrerr( "%s required for %c%c flag",
  504. X                               name, OptPrefix, arg_cname(ad) );
  505. X                       arg_flags(ad) = flags;
  506. X--- 429,435 ----
  507. X                       BSET( arg_flags(ad), ARGGIVEN );
  508. X                    }
  509. X                    else {
  510. X!                      (VOID) get_argname(arg_sname(ad), name);
  511. X                       usrerr( "%s required for %c%c flag",
  512. X                               name, OptPrefix, arg_cname(ad) );
  513. X                       arg_flags(ad) = flags;
  514. X***************
  515. X*** 585,597 ****
  516. X     char *pos;
  517. X     argName_t   name, keyword;
  518. X  
  519. X!    (VOID) get_name( arg_sname(ad), name );
  520. X  
  521. X     if (ARG_isPOSITIONAL(ad)) {
  522. X        sprintf( buf, "<%s>", name );
  523. X     }
  524. X     else {
  525. X!       (VOID) get_keyword( arg_sname(ad), keyword );
  526. X  
  527. X        if ( isupper(arg_cname(ad))  &&  toupper(*keyword) == arg_cname(ad) ) {
  528. X           *keyword = toupper(*keyword);
  529. X--- 585,597 ----
  530. X     char *pos;
  531. X     argName_t   name, keyword;
  532. X  
  533. X!    (VOID) get_argname( arg_sname(ad), name );
  534. X  
  535. X     if (ARG_isPOSITIONAL(ad)) {
  536. X        sprintf( buf, "<%s>", name );
  537. X     }
  538. X     else {
  539. X!       (VOID) get_kwdname( arg_sname(ad), keyword );
  540. X  
  541. X        if ( isupper(arg_cname(ad))  &&  toupper(*keyword) == arg_cname(ad) ) {
  542. X           *keyword = toupper(*keyword);
  543. X*** parseargs.awk.OLD    Mon Jun  3 11:17:09 1991
  544. X--- parseargs.awk    Wed May 15 10:03:26 1991
  545. X***************
  546. X*** 40,46 ****
  547. X  ##    The following global variables may be assigned before calling parseargs:
  548. X  ##
  549. X  ##       PROGNAME -- name of the current awk script (default= ARGV[0])
  550. X! ##       PARSEOPTS -- any extra options to pass toi parseargs() (default="-ul")
  551. X  ##       PARSEINPUT -- input file for parseargs(1) (default=unique-name)
  552. X  ##       PARSEOUTPUT -- output file for parseargs(1) (default=unique-name)
  553. X  ##
  554. X--- 40,46 ----
  555. X  ##    The following global variables may be assigned before calling parseargs:
  556. X  ##
  557. X  ##       PROGNAME -- name of the current awk script (default= ARGV[0])
  558. X! ##       PARSEOPTS -- any extra options to pass to parseargs() (default="-ul")
  559. X  ##       PARSEINPUT -- input file for parseargs(1) (default=unique-name)
  560. X  ##       PARSEOUTPUT -- output file for parseargs(1) (default=unique-name)
  561. X  ##
  562. X*** parseargs.c.OLD    Mon Jun  3 11:17:16 1991
  563. X--- parseargs.c    Thu May 16 16:51:21 1991
  564. X***************
  565. X*** 1092,1098 ****
  566. X  #endif
  567. X  {
  568. X     int  i;
  569. X!    register char *sh = sh_str;
  570. X  
  571. X        /* special case to recognize tcsh & itcsh */
  572. X     if ( strEQ( sh, "tcsh" ) )  ++sh;
  573. X--- 1092,1098 ----
  574. X  #endif
  575. X  {
  576. X     int  i;
  577. X!    register CONST char *sh = sh_str;
  578. X  
  579. X        /* special case to recognize tcsh & itcsh */
  580. X     if ( strEQ( sh, "tcsh" ) )  ++sh;
  581. X*** parseargs.h.OLD    Mon Jun  3 11:17:24 1991
  582. X--- parseargs.h    Mon May 20 17:35:46 1991
  583. X***************
  584. X*** 97,103 ****
  585. X  **       description (the description must be separated from the long-name by
  586. X  **       at least one whitespace character and may optionally be enclosed in
  587. X  **       a set of balanced delimiters (such as parentheses, curly-braces,
  588. X! **       square-brackets, or angle-brackets). If the long-name contains any
  589. X  **       uppercase characters, then the substring of long-name consisting of
  590. X  **       all uppercase characters is used as the argument keyword and the
  591. X  **       entire long-name is used as the name of the argument (if a value may
  592. X--- 97,108 ----
  593. X  **       description (the description must be separated from the long-name by
  594. X  **       at least one whitespace character and may optionally be enclosed in
  595. X  **       a set of balanced delimiters (such as parentheses, curly-braces,
  596. X! **       square-brackets, or angle-brackets). The longname may be specifed
  597. X! **       in two parts: a keyword name and an argument name. The argument
  598. X! **       name may be separated from the keyword name by a single equal sign
  599. X! **       ('='). No whitespace is allowed before or after the equal sign.
  600. X! **       Alternatatively, the keyword name may be distinguished from the
  601. X! **       argument name by character case: if the long-name contains any
  602. X  **       uppercase characters, then the substring of long-name consisting of
  603. X  **       all uppercase characters is used as the argument keyword and the
  604. X  **       entire long-name is used as the name of the argument (if a value may
  605. X***************
  606. X*** 140,146 ****
  607. X  #define  pe_NOMATCH   3
  608. X  /*    -- unable to match the named argument. This occurs
  609. X  **       when the argument keyword name passed to parsecntl() (using the 
  610. X! **       pc_ARGFLAGS functions code) was found in the given argdesc-array
  611. X  **       or in its default-list.
  612. X  */
  613. X  #define  pe_BADMODE   4
  614. X--- 145,151 ----
  615. X  #define  pe_NOMATCH   3
  616. X  /*    -- unable to match the named argument. This occurs
  617. X  **       when the argument keyword name passed to parsecntl() (using the 
  618. X! **       pc_ARGFLAGS function code) was NOT found in the given argdesc-array
  619. X  **       or in its default-list.
  620. X  */
  621. X  #define  pe_BADMODE   4
  622. X*** parseargs.pl.OLD    Mon Jun  3 11:17:30 1991
  623. X--- parseargs.pl    Wed May 15 10:02:06 1991
  624. X***************
  625. X*** 39,45 ****
  626. X  ;#    The global variable PARSEARGS will contain the command-line used to
  627. X  ;#    invoke parseargs(1).
  628. X  ;#
  629. X! ;#    ARGV and ARGC may be reset, all other values are (re)set in <arr>.
  630. X  ;#
  631. X  ;# ^RETURN-VALUE:
  632. X  ;#    The exit code returned by parseargs(1).
  633. X--- 39,45 ----
  634. X  ;#    The global variable PARSEARGS will contain the command-line used to
  635. X  ;#    invoke parseargs(1).
  636. X  ;#
  637. X! ;#    ARGV and (and any other variables named in <argd>) may be overwritten.
  638. X  ;#
  639. X  ;# ^RETURN-VALUE:
  640. X  ;#    The exit code returned by parseargs(1).
  641. X*** patchlevel.h.OLD    Mon Jun  3 11:17:35 1991
  642. X--- patchlevel.h    Mon Jun  3 10:35:24 1991
  643. X***************
  644. X*** 2,7 ****
  645. X--- 2,21 ----
  646. X  ** ^FILE: patchlevel.h - current patchlevel for parseargs
  647. X  **
  648. X  ** ^HISTORY:
  649. X+ **    05/11/91    Brad Appleton    <brad@ssd.csd.harris.com>
  650. X+ **    Patch06
  651. X+ **    - parsecntl(3) now correctly handles mispelled keywords for the
  652. X+ **      pc_ARGFLAGS request (it was looping forever).
  653. X+ **    - fixed an error in the documentation (a "NOT" was omitted).
  654. X+ **    - added #ifdef SVR4 stuff to unix_man.c to print System V Release 4
  655. X+ **      style manual pages.
  656. X+ **    - allowed "sname=aname" syntax in the ad_prompt field of an ARGDESC
  657. X+ **      in addition to the existing syntax. This new syntax allows argument
  658. X+ **      names to be be completely different from keyword names.
  659. X+ **    - changed get_name() & get_keyword to get_argname() & get_kwdname()
  660. X+ **      (respectively) in strfuncs.[ch]. Also sped up the algorithm to get
  661. X+ **      the keyword (since it no longer needs malloc).
  662. X+ **
  663. X  **    04/25/91    Brad Appleton    <brad@ssd.csd.harris.com>
  664. X  **    Patch05
  665. X  **    - documented support for zsh in parseargs(1)
  666. X***************
  667. X*** 66,72 ****
  668. X  
  669. X  #define  VERSION     2
  670. X  #define  REVISION    0
  671. X! #define  PATCHLEVEL  5
  672. X  
  673. X  #ifdef __STDC__
  674. X     static const char
  675. X--- 80,86 ----
  676. X  
  677. X  #define  VERSION     2
  678. X  #define  REVISION    0
  679. X! #define  PATCHLEVEL  6
  680. X  
  681. X  #ifdef __STDC__
  682. X     static const char
  683. X***************
  684. X*** 73,76 ****
  685. X  #else
  686. X     static char
  687. X  #endif
  688. X!    _Ident[] = "@(#)parseargs  2.0  patchlevel 5";
  689. X--- 87,90 ----
  690. X  #else
  691. X     static char
  692. X  #endif
  693. X!    _Ident[] = "@(#)parseargs  2.0  patchlevel 6";
  694. X*** stest.c.OLD    Mon Jun  3 11:17:47 1991
  695. X--- stest.c    Mon Jun  3 10:34:00 1991
  696. X***************
  697. X*** 115,121 ****
  698. X     'n', ARGREQ|ARGPOS, argStr,  __ &Name,  "name (name to look for)",
  699. X     's', ARGVALOPT, argStr,  __ &Str,       "STRing (optional string to use)",
  700. X     'g', ARGVEC,    argStr,  __ &Groups,    "newsGROUPS (newsgroups to test)",
  701. X!    'c', ARGOPT,    argInt,  __ &RepCount,  "REPcount (repeat count per group)",
  702. X     'd', ARGOPT,    argStr,   __ &DirName,  "DIRname (work directory)",
  703. X     'i', ARGVEC,    argInt,   __ &Integers, "INTegerS (vector of numbers)",
  704. X     '#', ARGHIDDEN, argBool,  __ &XRated,   "XratedMODE (naughty! naughty!)",
  705. X--- 115,121 ----
  706. X     'n', ARGREQ|ARGPOS, argStr,  __ &Name,  "name (name to look for)",
  707. X     's', ARGVALOPT, argStr,  __ &Str,       "STRing (optional string to use)",
  708. X     'g', ARGVEC,    argStr,  __ &Groups,    "newsGROUPS (newsgroups to test)",
  709. X!    'c', ARGOPT,    argInt,  __ &RepCount,  "REP=count (repeat count per group)",
  710. X     'd', ARGOPT,    argStr,   __ &DirName,  "DIRname (work directory)",
  711. X     'i', ARGVEC,    argInt,   __ &Integers, "INTegerS (vector of numbers)",
  712. X     '#', ARGHIDDEN, argBool,  __ &XRated,   "XratedMODE (naughty! naughty!)",
  713. X***************
  714. X*** 124,130 ****
  715. X     'y', ARGOPT, argUBool, __ &YFlag, "Yflag (unset Y flag)",
  716. X     'z', ARGOPT, argTBool, __ &ZFlag, "Zflag (toggle Z flag)",
  717. X  
  718. X!    't', ARGOPT,   argChar, __ &TabChar, "TABchar (field delimiter)",
  719. X     'r', ARGNOVAL, argMine, __ NULL,     "raw (trigger raw-mode \
  720. X  before processing any more arguments on the command-line)",
  721. X  
  722. X--- 124,130 ----
  723. X     'y', ARGOPT, argUBool, __ &YFlag, "Yflag (unset Y flag)",
  724. X     'z', ARGOPT, argTBool, __ &ZFlag, "Zflag (toggle Z flag)",
  725. X  
  726. X!    't', ARGOPT,   argChar, __ &TabChar, "TAB=char (field delimiter)",
  727. X     'r', ARGNOVAL, argMine, __ NULL,     "raw (trigger raw-mode \
  728. X  before processing any more arguments on the command-line)",
  729. X  
  730. X***************
  731. X*** 143,149 ****
  732. X     'n', ARGREQ|ARGPOS, argStr,  __ &Name,  "name (name to look for)",
  733. X     's', ARGVALOPT, argStr,  __ &Str,       "STRing (optional string to use)",
  734. X     'g', ARGVEC,    argStr,  __ &Groups,    "newsGROUPS (newsgroups to test)",
  735. X!    'c', ARGOPT,    argInt,  __ &RepCount,  "REPcount (repeat count per group)",
  736. X     'd', ARGOPT,    argStr,   __ &DirName,  "DIRname (work directory)",
  737. X     'i', ARGVEC,    argInt,   __ &Integers, "INTegerS (vector of numbers)",
  738. X     '#', ARGHIDDEN, argBool,  __ &XRated,   "XratedMODE (naughty! naughty!)",
  739. X--- 143,149 ----
  740. X     'n', ARGREQ|ARGPOS, argStr,  __ &Name,  "name (name to look for)",
  741. X     's', ARGVALOPT, argStr,  __ &Str,       "STRing (optional string to use)",
  742. X     'g', ARGVEC,    argStr,  __ &Groups,    "newsGROUPS (newsgroups to test)",
  743. X!    'c', ARGOPT,    argInt,  __ &RepCount,  "REP=count (repeat count per group)",
  744. X     'd', ARGOPT,    argStr,   __ &DirName,  "DIRname (work directory)",
  745. X     'i', ARGVEC,    argInt,   __ &Integers, "INTegerS (vector of numbers)",
  746. X     '#', ARGHIDDEN, argBool,  __ &XRated,   "XratedMODE (naughty! naughty!)",
  747. X***************
  748. X*** 152,158 ****
  749. X     'y', ARGOPT, argUBool, __ &YFlag, "Yflag (unset Y flag)",
  750. X     'z', ARGOPT, argTBool, __ &ZFlag, "Zflag (toggle Z flag)",
  751. X  
  752. X!    't', ARGOPT,   argChar, __ &TabChar, "TABchar (field delimiter)",
  753. X     'r', ARGNOVAL, argMine, __ NULL,     "raw (trigger raw-mode \
  754. X  before processing any more arguments on the command-line)",
  755. X  
  756. X--- 152,158 ----
  757. X     'y', ARGOPT, argUBool, __ &YFlag, "Yflag (unset Y flag)",
  758. X     'z', ARGOPT, argTBool, __ &ZFlag, "Zflag (toggle Z flag)",
  759. X  
  760. X!    't', ARGOPT,   argChar, __ &TabChar, "TAB=char (field delimiter)",
  761. X     'r', ARGNOVAL, argMine, __ NULL,     "raw (trigger raw-mode \
  762. X  before processing any more arguments on the command-line)",
  763. X  
  764. X***************
  765. X*** 258,264 ****
  766. X     printf( "XRated=%d, Raw-Mode = \"%s\"\n", XRated, Mode );
  767. X  
  768. X        /* to call parsecntl() to see if the optional value was supplied */
  769. X!    (VOID) parsecntl( (ARGDESC *)argd, pc_ARGFLAGS, pc_READ, "string", &flags);
  770. X  
  771. X     if ( BTEST(flags, ARGGIVEN) && !BTEST(flags, ARGVALGIVEN) ) {
  772. X        printf("String=!No Value Given on CmdLine!\n" );
  773. X--- 258,264 ----
  774. X     printf( "XRated=%d, Raw-Mode = \"%s\"\n", XRated, Mode );
  775. X  
  776. X        /* to call parsecntl() to see if the optional value was supplied */
  777. X!    i = parsecntl( (ARGDESC *)argd, pc_ARGFLAGS, pc_READ, "string", &flags);
  778. X  
  779. X     if ( BTEST(flags, ARGGIVEN) && !BTEST(flags, ARGVALGIVEN) ) {
  780. X        printf("String=!No Value Given on CmdLine!\n" );
  781. X*** strfuncs.c.OLD    Mon Jun  3 11:17:52 1991
  782. X--- strfuncs.c    Wed May 15 14:33:16 1991
  783. X***************
  784. X*** 23,30 ****
  785. X  **       strtrim() -- trim leading and trailing characters in a string
  786. X  **       strsplit() -- split a string up into a vector of tokens
  787. X  **       strjoin() -- join a vector of tokens into a single string
  788. X! **       get_name() -- return the aname (argument-name) of an argument
  789. X! **       get_keyword() -- return the sname (keyword-name) of an argument
  790. X  **       match() -- match two keywords (case insensitive) upto a unique prefix
  791. X  **       basename() -- remove the leading directories (and disks) from a path
  792. X  **       indent_para() -- print an indented hanging paragraph
  793. X--- 23,30 ----
  794. X  **       strtrim() -- trim leading and trailing characters in a string
  795. X  **       strsplit() -- split a string up into a vector of tokens
  796. X  **       strjoin() -- join a vector of tokens into a single string
  797. X! **       get_argname() -- return the aname (argument-name) of an argument
  798. X! **       get_kwdname() -- return the sname (keyword-name) of an argument
  799. X  **       match() -- match two keywords (case insensitive) upto a unique prefix
  800. X  **       basename() -- remove the leading directories (and disks) from a path
  801. X  **       indent_para() -- print an indented hanging paragraph
  802. X***************
  803. X*** 47,57 ****
  804. X  
  805. X  static CONST char WhiteSpace[] = " \t\n\r\v\f";
  806. X  
  807. X! 
  808. X  #if ( defined(unix_style)  ||  defined(ibm_style) )
  809. X  # define  TO_KWDCASE(c)  TOLOWER(c)
  810. X  #else
  811. X  # define  TO_KWDCASE(c)  TOUPPER(c)
  812. X  #endif
  813. X  
  814. X  
  815. X--- 47,59 ----
  816. X  
  817. X  static CONST char WhiteSpace[] = " \t\n\r\v\f";
  818. X  
  819. X! #define c_ARG_SEP '='
  820. X  #if ( defined(unix_style)  ||  defined(ibm_style) )
  821. X  # define  TO_KWDCASE(c)  TOLOWER(c)
  822. X+ # define  KWDCASECOPY(dest,src)  strlcpy(dest,src)
  823. X  #else
  824. X  # define  TO_KWDCASE(c)  TOUPPER(c)
  825. X+ # define  KWDCASECOPY(dest,src)  strucpy(dest,src)
  826. X  #endif
  827. X  
  828. X  
  829. X***************
  830. X*** 746,757 ****
  831. X  
  832. X  
  833. X  /***************************************************************************
  834. X! ** ^FUNCTION: get_name - return the aname (argument-name) of an argument
  835. X  **
  836. X  ** ^SYNOPSIS:
  837. X  */
  838. X  #ifndef __ANSI_C__
  839. X!    char  *get_name( s, buf )
  840. X  /*
  841. X  ** ^PARAMETERS:
  842. X  */
  843. X--- 748,759 ----
  844. X  
  845. X  
  846. X  /***************************************************************************
  847. X! ** ^FUNCTION: get_argname - return the aname (argument-name) of an argument
  848. X  **
  849. X  ** ^SYNOPSIS:
  850. X  */
  851. X  #ifndef __ANSI_C__
  852. X!    char  *get_argname( s, buf )
  853. X  /*
  854. X  ** ^PARAMETERS:
  855. X  */
  856. X***************
  857. X*** 764,770 ****
  858. X  #endif  /* !__ANSI_C__ */
  859. X  
  860. X  /* ^DESCRIPTION:
  861. X! **    Get_name will get the full argument name of the given argument
  862. X  **    (not just the keyword name) and copy it to buf.
  863. X  **
  864. X  ** ^REQUIREMENTS:
  865. X--- 766,772 ----
  866. X  #endif  /* !__ANSI_C__ */
  867. X  
  868. X  /* ^DESCRIPTION:
  869. X! **    Get_argname will get the full argument name of the given argument
  870. X  **    (not just the keyword name) and copy it to buf.
  871. X  **
  872. X  ** ^REQUIREMENTS:
  873. X***************
  874. X*** 782,803 ****
  875. X  **    and copy the result in the given buffer
  876. X  ***^^**********************************************************************/
  877. X  #ifdef __ANSI_C__
  878. X!    char *get_name( const char *s, char *buf )
  879. X  #endif
  880. X  {
  881. X!       /* <buf> must be large enough to hold the result! */
  882. X!    strlcpy(buf, s);
  883. X     return   buf;
  884. X  }
  885. X  
  886. X  
  887. X  /***************************************************************************
  888. X! ** ^FUNCTION: get_keyword - get the sname (keyword name) of an argument
  889. X  **
  890. X  ** ^SYNOPSIS:
  891. X  */
  892. X  #ifndef __ANSI_C__
  893. X!    char  *get_keyword( s, buf )
  894. X  /*
  895. X  ** ^PARAMETERS:
  896. X  */
  897. X--- 784,815 ----
  898. X  **    and copy the result in the given buffer
  899. X  ***^^**********************************************************************/
  900. X  #ifdef __ANSI_C__
  901. X!    char *get_argname( const char *s, char *buf )
  902. X  #endif
  903. X  {
  904. X!    register CONST char *p1 = s, *p2;
  905. X! 
  906. X!       /* see if sname and aname are separated by c_ARG_SEP
  907. X!       ** <buf> must be large enough to hold the result!
  908. X!       */
  909. X!    p2 = strchr( p1, c_ARG_SEP );
  910. X!    if ( p2 ) {
  911. X!       strlcpy( buf, ++p2 );
  912. X!    }
  913. X!    else {
  914. X!       strlcpy(buf, s);
  915. X!    }
  916. X     return   buf;
  917. X  }
  918. X  
  919. X  
  920. X  /***************************************************************************
  921. X! ** ^FUNCTION: get_kwdname - get the sname (keyword name) of an argument
  922. X  **
  923. X  ** ^SYNOPSIS:
  924. X  */
  925. X  #ifndef __ANSI_C__
  926. X!    char  *get_kwdname( s, buf )
  927. X  /*
  928. X  ** ^PARAMETERS:
  929. X  */
  930. X***************
  931. X*** 810,816 ****
  932. X  #endif  /* !__ANSI_C__ */
  933. X  
  934. X  /* ^DESCRIPTION:
  935. X! **    Get_name will get the keyword name of the given argument
  936. X  **    (not the entire argument name) and copy it to buf.
  937. X  **
  938. X  **    The sname (keyword-name) consists only of all uppercase characters
  939. X--- 822,828 ----
  940. X  #endif  /* !__ANSI_C__ */
  941. X  
  942. X  /* ^DESCRIPTION:
  943. X! **    Get_kwdname will get the keyword name of the given argument
  944. X  **    (not the entire argument name) and copy it to buf.
  945. X  **
  946. X  **    The sname (keyword-name) consists only of all uppercase characters
  947. X***************
  948. X*** 833,877 ****
  949. X  **    and copy the result in the given buffer
  950. X  ***^^**********************************************************************/
  951. X  #ifdef __ANSI_C__
  952. X!    char *get_keyword( const char *s, char *buf )
  953. X  #endif
  954. X  {
  955. X!    register char *p1 = (char *)s, *p2;
  956. X!    register int   i, len = 0;
  957. X!    char *caps = CHARNULL;
  958. X  
  959. X     if ( !p1 )  return  CHARNULL;
  960. X  
  961. X!       /* find size to copy (use all caps if possible) */
  962. X!    for ( p1 = (char *)s ; *p1 ; p1++ )   {
  963. X!      if ( !caps  &&  isupper( *p1 ) )  caps = p1;
  964. X!          if ( caps   &&   isupper( *p1 ) )   ++len;
  965. X     }
  966. X-    if ( !caps )   len = (int) (p1 - (char *)s);
  967. X  
  968. X        /* copy string into buffer and convert it to desired case */
  969. X        /* <buf> must be large enough to hold the result! */
  970. X!    p1 = buf;
  971. X!    if ( len )   {
  972. X!      if ( !caps ) {
  973. X!         for ( p1 = buf, p2 = (char *)s, i = 0 ; i < len ; p1++, p2++, i++ ) {
  974. X!             *p1 = TO_KWDCASE(*p2);
  975. X!         }
  976. X!      }/*if*/
  977. X  
  978. X-      else {
  979. X-         for ( p2 = caps, i = 0 ; i < len ; p2++ ) {
  980. X-            if ( isupper( *p2 ) )   {
  981. X-               *(p1++) = TO_KWDCASE(*p2);
  982. X-               ++i;
  983. X-            }
  984. X-         }/*for*/
  985. X-      }/*else*/
  986. X-    }/*if*/
  987. X-    *p1 = '\0';
  988. X- 
  989. X     return   buf;   /* return buffer address */
  990. X  }
  991. X  #ifndef amiga_style
  992. X  
  993. X  /***************************************************************************
  994. X--- 845,887 ----
  995. X  **    and copy the result in the given buffer
  996. X  ***^^**********************************************************************/
  997. X  #ifdef __ANSI_C__
  998. X!    char *get_kwdname( const char *s, char *buf )
  999. X  #endif
  1000. X  {
  1001. X!    register char *p1 = (char *)s, *p2, ch;
  1002. X!    BOOL caps = FALSE;
  1003. X  
  1004. X     if ( !p1 )  return  CHARNULL;
  1005. X  
  1006. X!       /* see if sname and aname are separated by c_ARG_SEP */
  1007. X!    p2 = strchr( p1, c_ARG_SEP );
  1008. X!    if ( p2 ) {
  1009. X!       ch = *p2;
  1010. X!       *p2 = '\0';
  1011. X!       KWDCASECOPY( buf, p1 );
  1012. X!       *p2 = ch;
  1013. X!       return  buf;
  1014. X     }
  1015. X  
  1016. X        /* copy string into buffer and convert it to desired case */
  1017. X        /* <buf> must be large enough to hold the result! */
  1018. X!    for ( p2 = buf; *p1 ; p1++ ) {
  1019. X!       if ( isupper(*p1) ) {
  1020. X!          if ( !caps ) {
  1021. X!             caps = TRUE;
  1022. X!             p2 = buf;
  1023. X!          }
  1024. X!          *p2++ = TO_KWDCASE(*p1);
  1025. X!       }
  1026. X!       else if ( !caps ) {
  1027. X!          *p2++ = TO_KWDCASE(*p1);
  1028. X!       }
  1029. X!    }
  1030. X!    *p2 = '\0';
  1031. X  
  1032. X     return   buf;   /* return buffer address */
  1033. X  }
  1034. X+ 
  1035. X  #ifndef amiga_style
  1036. X  
  1037. X  /***************************************************************************
  1038. X***************
  1039. X*** 928,945 ****
  1040. X  #endif
  1041. X  {
  1042. X     int  i, clen, tlen, too_short=0;
  1043. X!    CONST char *full_targ;
  1044. X!    char *up_targ;
  1045. X  
  1046. X  
  1047. X!    full_targ = target;
  1048. X  
  1049. X-       /* make up_targ the uppercase portion of target */
  1050. X-    up_targ = strdup( full_targ );
  1051. X-    (VOID) get_keyword( full_targ, up_targ );
  1052. X- 
  1053. X        /* match at least MINLEN characters if possible */
  1054. X!    tlen = strlen( up_targ );
  1055. X     clen = strlen( candidate );
  1056. X     if ( (tlen >= MINLEN)   &&   (clen < MINLEN) ) {
  1057. X        ++too_short;      /* not long enough -- no match */
  1058. X--- 938,951 ----
  1059. X  #endif
  1060. X  {
  1061. X     int  i, clen, tlen, too_short=0;
  1062. X!    char  arg_targ[ 256 ], kwd_targ[ 256 ];
  1063. X  
  1064. X  
  1065. X!       /* make kwd_targ the keyword portion of target */
  1066. X!    (VOID) get_kwdname( target, kwd_targ );
  1067. X  
  1068. X        /* match at least MINLEN characters if possible */
  1069. X!    tlen = strlen( kwd_targ );
  1070. X     clen = strlen( candidate );
  1071. X     if ( (tlen >= MINLEN)   &&   (clen < MINLEN) ) {
  1072. X        ++too_short;      /* not long enough -- no match */
  1073. X***************
  1074. X*** 947,953 ****
  1075. X  
  1076. X  #ifdef vms_style
  1077. X        /* if first two chars are NO then match at least MINLEN+2 chars */
  1078. X!    if ( !strnicmp(up_targ, "NO", 2) ) {
  1079. X        if ( (tlen >= (MINLEN + 2))   &&   (clen < (MINLEN + 2)) ) {
  1080. X           ++too_short;      /* not long enough -- no match */
  1081. X        }
  1082. X--- 953,959 ----
  1083. X  
  1084. X  #ifdef vms_style
  1085. X        /* if first two chars are NO then match at least MINLEN+2 chars */
  1086. X!    if ( !strnicmp(kwd_targ, "NO", 2) ) {
  1087. X        if ( (tlen >= (MINLEN + 2))   &&   (clen < (MINLEN + 2)) ) {
  1088. X           ++too_short;      /* not long enough -- no match */
  1089. X        }
  1090. X***************
  1091. X*** 954,971 ****
  1092. X     }
  1093. X  #endif
  1094. X  
  1095. X!       /* first try to match prefix of the uppercase portion */
  1096. X!    i = (too_short) ? -1 : strnicmp(up_targ, candidate, clen);
  1097. X  
  1098. X-    free( up_targ );
  1099. X- 
  1100. X        /* did we match? */
  1101. X     if ( !i )  return  0;   /* yes! */
  1102. X  
  1103. X!    /* no! : compare the whole target
  1104. X     **       match at least MINLEN characters if possible
  1105. X     */
  1106. X!    tlen = strlen(full_targ);
  1107. X     if ( (tlen >= MINLEN)   &&   (clen < MINLEN) ) {
  1108. X        return   -1;      /* not long enough -- no match */
  1109. X     }
  1110. X--- 960,978 ----
  1111. X     }
  1112. X  #endif
  1113. X  
  1114. X!       /* first try to match prefix of the keyword portion */
  1115. X!    i = (too_short) ? -1 : strnicmp(kwd_targ, candidate, clen);
  1116. X  
  1117. X        /* did we match? */
  1118. X     if ( !i )  return  0;   /* yes! */
  1119. X  
  1120. X!    /* no! : compare the argument portion
  1121. X     **       match at least MINLEN characters if possible
  1122. X     */
  1123. X!       /* make arg_targ the argument portion of target */
  1124. X!    (VOID) get_argname( target, arg_targ );
  1125. X! 
  1126. X!    tlen = strlen(arg_targ);
  1127. X     if ( (tlen >= MINLEN)   &&   (clen < MINLEN) ) {
  1128. X        return   -1;      /* not long enough -- no match */
  1129. X     }
  1130. X***************
  1131. X*** 972,978 ****
  1132. X  
  1133. X  #ifdef vms_style
  1134. X     /* if first two chars are NO then match at least MINLEN+2 chars */
  1135. X!    if ( !strnicmp(full_targ, "no", 2) ) {
  1136. X        if ( (tlen >= (MINLEN + 2))   &&   (clen < (MINLEN + 2)) ) {
  1137. X           return   -1;      /* not long enough -- no match */
  1138. X        }
  1139. X--- 979,985 ----
  1140. X  
  1141. X  #ifdef vms_style
  1142. X     /* if first two chars are NO then match at least MINLEN+2 chars */
  1143. X!    if ( !strnicmp(arg_targ, "no", 2) ) {
  1144. X        if ( (tlen >= (MINLEN + 2))   &&   (clen < (MINLEN + 2)) ) {
  1145. X           return   -1;      /* not long enough -- no match */
  1146. X        }
  1147. X***************
  1148. X*** 979,985 ****
  1149. X     }
  1150. X  #endif
  1151. X  
  1152. X!    return   strnicmp(full_targ, candidate, clen);
  1153. X  }
  1154. X  
  1155. X  
  1156. X--- 986,992 ----
  1157. X     }
  1158. X  #endif
  1159. X  
  1160. X!    return  strnicmp(arg_targ, candidate, clen);
  1161. X  }
  1162. X  
  1163. X  
  1164. X***************
  1165. X*** 992,1014 ****
  1166. X     int match( candidate, target) char *candidate, *target;
  1167. X  # endif
  1168. X  {
  1169. X!    int i, j;
  1170. X!    char c;
  1171. X  
  1172. X!    i = j = 0;
  1173. X  
  1174. X!    while ( isgraph(target[i]) || isgraph(candidate[i]) ) {
  1175. X!       while ( islower(target[i]) ) i++;
  1176. X!       if ( !isgraph(target[i]) ) {
  1177. X!          if ( !isgraph(candidate[j]) )  return 0;
  1178. X!          return  stricmp(target, candidate);
  1179. X!       }
  1180. X!       c = islower( candidate[j] ) ? toupper(candidate[j]) : candidate[j];
  1181. X!       if (target[i] != c)  return  stricmp(target, candidate);
  1182. X!       i++;
  1183. X!       j++;
  1184. X!    }
  1185. X!    return 0;
  1186. X  }
  1187. X  
  1188. X  #endif
  1189. X--- 999,1016 ----
  1190. X     int match( candidate, target) char *candidate, *target;
  1191. X  # endif
  1192. X  {
  1193. X!    char kwd_targ[ 256 ], arg_targ[ 256 ];
  1194. X!    int rc;
  1195. X  
  1196. X!    (VOID) get_kwdname( target, kwd_targ );
  1197. X!    rc = stricmp( kwd_targ, candidate );
  1198. X  
  1199. X!    if ( rc == 0 )  return  0;
  1200. X! 
  1201. X!    (VOID) get_argname( target, arg_targ );
  1202. X!    rc = stricmp( arg_targ, candidate );
  1203. X! 
  1204. X!    return  rc;
  1205. X  }
  1206. X  
  1207. X  #endif
  1208. X*** strfuncs.h.OLD    Mon Jun  3 11:18:00 1991
  1209. X--- strfuncs.h    Mon May 13 13:59:31 1991
  1210. X***************
  1211. X*** 33,40 ****
  1212. X  EXTERN  int    strsplit     ARGS(( char ***, char *, const char * ));
  1213. X  EXTERN  char  *strjoin      ARGS(( const char **, const char * ));
  1214. X  
  1215. X! EXTERN  char  *get_name     ARGS(( const char *, char * ));
  1216. X! EXTERN  char  *get_keyword  ARGS(( const char *, char * ));
  1217. X  EXTERN  int    match        ARGS(( const char *, const char * ));
  1218. X  EXTERN  char  *basename     ARGS(( char * ));
  1219. X  EXTERN  VOID   indent_para  ARGS(( FILE *, int, int,
  1220. X--- 33,40 ----
  1221. X  EXTERN  int    strsplit     ARGS(( char ***, char *, const char * ));
  1222. X  EXTERN  char  *strjoin      ARGS(( const char **, const char * ));
  1223. X  
  1224. X! EXTERN  char  *get_argname  ARGS(( const char *, char * ));
  1225. X! EXTERN  char  *get_kwdname  ARGS(( const char *, char * ));
  1226. X  EXTERN  int    match        ARGS(( const char *, const char * ));
  1227. X  EXTERN  char  *basename     ARGS(( char * ));
  1228. X  EXTERN  VOID   indent_para  ARGS(( FILE *, int, int,
  1229. X*** unix_args.c.OLD    Mon Jun  3 11:18:42 1991
  1230. X--- unix_args.c    Mon May 13 13:44:30 1991
  1231. X***************
  1232. X*** 215,221 ****
  1233. X                    BSET( arg_flags(ad), ARGGIVEN );
  1234. X                 }
  1235. X                 else {
  1236. X!                   (VOID) get_keyword( arg_sname(ad), name );
  1237. X                    usrerr("option %c%s requires an argument", c_KWD_PFX, name);
  1238. X                    arg_flags(ad) = flags;
  1239. X                    parse_error = pe_SYNTAX;
  1240. X--- 215,221 ----
  1241. X                    BSET( arg_flags(ad), ARGGIVEN );
  1242. X                 }
  1243. X                 else {
  1244. X!                   (VOID) get_kwdname( arg_sname(ad), name );
  1245. X                    usrerr("option %c%s requires an argument", c_KWD_PFX, name);
  1246. X                    arg_flags(ad) = flags;
  1247. X                    parse_error = pe_SYNTAX;
  1248. X***************
  1249. X*** 339,345 ****
  1250. X                       BSET( arg_flags(ad), ARGGIVEN );
  1251. X                    }
  1252. X                    else {
  1253. X!                      (VOID) get_name(arg_sname(ad), name);
  1254. X                       usrerr( "%s required for %c%c flag",
  1255. X                               name, c_OPT_PFX, arg_cname(ad) );
  1256. X                       arg_flags(ad) = flags;
  1257. X--- 339,345 ----
  1258. X                       BSET( arg_flags(ad), ARGGIVEN );
  1259. X                    }
  1260. X                    else {
  1261. X!                      (VOID) get_argname(arg_sname(ad), name);
  1262. X                       usrerr( "%s required for %c%c flag",
  1263. X                               name, c_OPT_PFX, arg_cname(ad) );
  1264. X                       arg_flags(ad) = flags;
  1265. X***************
  1266. X*** 505,517 ****
  1267. X     char *pos;
  1268. X     argName_t   name, keyword;
  1269. X  
  1270. X!    (VOID) get_name( arg_sname(ad), name );
  1271. X  
  1272. X     if (ARG_isPOSITIONAL(ad)) {
  1273. X        sprintf( buf, "<%s>", name );
  1274. X     }
  1275. X     else {
  1276. X!       (VOID) get_keyword( arg_sname(ad), keyword );
  1277. X  
  1278. X        if ( isupper(arg_cname(ad))  &&  toupper(*keyword) == arg_cname(ad) ) {
  1279. X           *keyword = toupper(*keyword);
  1280. X--- 505,517 ----
  1281. X     char *pos;
  1282. X     argName_t   name, keyword;
  1283. X  
  1284. X!    (VOID) get_argname( arg_sname(ad), name );
  1285. X  
  1286. X     if (ARG_isPOSITIONAL(ad)) {
  1287. X        sprintf( buf, "<%s>", name );
  1288. X     }
  1289. X     else {
  1290. X!       (VOID) get_kwdname( arg_sname(ad), keyword );
  1291. X  
  1292. X        if ( isupper(arg_cname(ad))  &&  toupper(*keyword) == arg_cname(ad) ) {
  1293. X           *keyword = toupper(*keyword);
  1294. X*** unix_man.c.OLD    Mon Jun  3 11:18:48 1991
  1295. X--- unix_man.c    Mon May 13 13:44:31 1991
  1296. X***************
  1297. X*** 75,81 ****
  1298. X     char *pos;
  1299. X     argName_t   name;
  1300. X  
  1301. X!    (VOID) get_name( arg_sname(ad), name );
  1302. X  
  1303. X     if (ARG_isPOSITIONAL(ad)) {
  1304. X         if ( ARG_isMULTIVAL(ad) ) {
  1305. X--- 75,81 ----
  1306. X     char *pos;
  1307. X     argName_t   name;
  1308. X  
  1309. X!    (VOID) get_argname( arg_sname(ad), name );
  1310. X  
  1311. X     if (ARG_isPOSITIONAL(ad)) {
  1312. X         if ( ARG_isMULTIVAL(ad) ) {
  1313. X***************
  1314. X*** 87,93 ****
  1315. X--- 87,97 ----
  1316. X         return  strlen(name);
  1317. X     }/*if parm*/
  1318. X  
  1319. X+ #ifdef SVR4
  1320. X+    sprintf(buf, "\\f4\\-%c\\fP", arg_cname(ad));
  1321. X+ #else
  1322. X     sprintf(buf, "\\fB\\-%c\\fP", arg_cname(ad));
  1323. X+ #endif
  1324. X     pos = buf + strlen(buf);
  1325. X  
  1326. X     if ( ARG_isVALTAKEN(ad)  &&  !ARG_isBOOLEAN(ad)  &&  !ARG_isPSEUDOARG(ad) ) {
  1327. X***************
  1328. X*** 185,191 ****
  1329. X--- 189,199 ----
  1330. X     printf(".if n .ll 78\n");
  1331. X  
  1332. X     COMMENT;
  1333. X+ #ifdef SVR4
  1334. X+    TH( name, 1 );
  1335. X+ #else
  1336. X     TH( strupr(name), 1 );
  1337. X+ #endif
  1338. X  
  1339. X     COMMENT;
  1340. X     SH( "NAME" );
  1341. X***************
  1342. X*** 195,201 ****
  1343. X--- 203,213 ----
  1344. X     SH( "SYNOPSIS" );
  1345. X  
  1346. X     len = strlen( program ) + 1;
  1347. X+ #ifdef SVR4
  1348. X+    sprintf( name, "\\f4%s\\fP", program );
  1349. X+ #else
  1350. X     sprintf( name, "\\fB%s\\fP", program );
  1351. X+ #endif
  1352. X     TP( len, name );
  1353. X  
  1354. X     maxlen = 0;
  1355. X*** useful.h.OLD    Mon Jun  3 11:18:52 1991
  1356. X--- useful.h    Thu May 16 16:21:26 1991
  1357. X***************
  1358. X*** 31,36 ****
  1359. X--- 31,42 ----
  1360. X  # endif
  1361. X  #endif /* _unix */
  1362. X  
  1363. X+ #if (defined(_UNIX) || defined(__UNIX) || defined(_UNIX_) || defined(__UNIX__))
  1364. X+ # ifndef unix
  1365. X+ #   define unix
  1366. X+ # endif
  1367. X+ #endif /* _UNIX */
  1368. X+ 
  1369. X     /* give a stab at the dual Unix universe dilemma (UCB vs AT&T) */
  1370. X  #ifdef unix
  1371. X  # if ( defined(_BSD) && !defined(BSD) )
  1372. X***************
  1373. X*** 84,102 ****
  1374. X  #endif /* unix */
  1375. X  
  1376. X  #ifndef MSDOS
  1377. X! # if ( defined(_MSDOS_) || defined(__MSDOS__) || defined(_MSDOS) )
  1378. X  #  define MSDOS
  1379. X  # endif
  1380. X  #endif
  1381. X  
  1382. X  #ifndef OS2
  1383. X! # if ( defined(_OS2_) || defined(__OS2__) || defined(_OS2) )
  1384. X  #  define OS2
  1385. X  # endif
  1386. X  #endif
  1387. X  
  1388. X  #ifndef AmigaDOS
  1389. X! # if ( defined(MANX) || defined(AZTEC) )
  1390. X  #   define AmigaDOS
  1391. X  # endif
  1392. X  #endif /* AmigaDOS */
  1393. X--- 90,108 ----
  1394. X  #endif /* unix */
  1395. X  
  1396. X  #ifndef MSDOS
  1397. X! # if (defined(_MSDOS_)||defined(__MSDOS__)||defined(_MSDOS)||defined(__MSDOS))
  1398. X  #  define MSDOS
  1399. X  # endif
  1400. X  #endif
  1401. X  
  1402. X  #ifndef OS2
  1403. X! # if ( defined(_OS2_) || defined(__OS2__) || defined(_OS2) || defined(__OS2) )
  1404. X  #  define OS2
  1405. X  # endif
  1406. X  #endif
  1407. X  
  1408. X  #ifndef AmigaDOS
  1409. X! # if ( defined(AMIGA) || defined(MANX) || defined(AZTEC) )
  1410. X  #   define AmigaDOS
  1411. X  # endif
  1412. X  #endif /* AmigaDOS */
  1413. X***************
  1414. X*** 303,312 ****
  1415. X  # endif  /* !_SIZE_T_DEFINED */
  1416. X  #endif
  1417. X  
  1418. X! #ifndef __malloc_h
  1419. X!  EXTERN  ARBPTR  malloc   ARGS(( size_t ));
  1420. X!  EXTERN  ARBPTR  realloc  ARGS(( ARBPTR, size_t ));
  1421. X!  EXTERN  VOID    free     ARGS(( ARBPTR ));
  1422. X  #endif /*__malloc_h*/
  1423. X  
  1424. X  EXTERN  ARBPTR  ckalloc  ARGS(( size_t ));
  1425. X--- 309,316 ----
  1426. X  # endif  /* !_SIZE_T_DEFINED */
  1427. X  #endif
  1428. X  
  1429. X! #if ( !defined(__malloc_h) && !defined(__MALLOC_H) )
  1430. X! # include <malloc.h>
  1431. X  #endif /*__malloc_h*/
  1432. X  
  1433. X  EXTERN  ARBPTR  ckalloc  ARGS(( size_t ));
  1434. X*** vms_args.c.OLD    Mon Jun  3 11:18:57 1991
  1435. X--- vms_args.c    Mon May 13 13:44:32 1991
  1436. X***************
  1437. X*** 683,689 ****
  1438. X                 BSET( arg_flags(ad), ARGVALGIVEN );
  1439. X              }
  1440. X              else {
  1441. X!                (VOID) get_keyword( arg_sname(ad), keyword );
  1442. X                 usrerr("qualifier %s requires an argument", keyword);
  1443. X                 arg_flags(ad) = flags;
  1444. X                 parse_error = pe_SYNTAX;
  1445. X--- 683,689 ----
  1446. X                 BSET( arg_flags(ad), ARGVALGIVEN );
  1447. X              }
  1448. X              else {
  1449. X!                (VOID) get_kwdname( arg_sname(ad), keyword );
  1450. X                 usrerr("qualifier %s requires an argument", keyword);
  1451. X                 arg_flags(ad) = flags;
  1452. X                 parse_error = pe_SYNTAX;
  1453. X***************
  1454. X*** 849,861 ****
  1455. X     char * pos;
  1456. X     argName_t  keyword, name;
  1457. X  
  1458. X!    (VOID) get_name( arg_sname(ad), name );
  1459. X  
  1460. X     if (ARG_isPOSITIONAL(ad)) {
  1461. X        sprintf( buf, "<%s>", name );
  1462. X     }
  1463. X     else {
  1464. X!       (VOID) get_keyword( arg_sname(ad), keyword );
  1465. X        sprintf( buf, "%c%s", *s_KWD_PFX, keyword );
  1466. X        pos = buf + strlen(buf);
  1467. X  
  1468. X--- 849,861 ----
  1469. X     char * pos;
  1470. X     argName_t  keyword, name;
  1471. X  
  1472. X!    (VOID) get_argname( arg_sname(ad), name );
  1473. X  
  1474. X     if (ARG_isPOSITIONAL(ad)) {
  1475. X        sprintf( buf, "<%s>", name );
  1476. X     }
  1477. X     else {
  1478. X!       (VOID) get_kwdname( arg_sname(ad), keyword );
  1479. X        sprintf( buf, "%c%s", *s_KWD_PFX, keyword );
  1480. X        pos = buf + strlen(buf);
  1481. X  
  1482. X***************
  1483. X*** 965,971 ****
  1484. X  
  1485. X  
  1486. X              if ( ARG_isMULTIVAL(ad) ) {
  1487. X!                (VOID) get_name( arg_sname(ad), name );
  1488. X                 strcat(buf, "[,<");
  1489. X                 strcat(buf, name);
  1490. X                 strcat(buf, ">...]");
  1491. X--- 965,971 ----
  1492. X  
  1493. X  
  1494. X              if ( ARG_isMULTIVAL(ad) ) {
  1495. X!                (VOID) get_argname( arg_sname(ad), name );
  1496. X                 strcat(buf, "[,<");
  1497. X                 strcat(buf, name);
  1498. X                 strcat(buf, ">...]");
  1499. X*** xparse.c.OLD    Mon Jun  3 11:19:13 1991
  1500. X--- xparse.c    Mon Jun  3 10:29:49 1991
  1501. X***************
  1502. X*** 857,872 ****
  1503. X           if ( ARG_isREQUIRED(ad)  &&  !ARG_isGIVEN(ad) ) {
  1504. X                 /* still didn't get a value... sigh */
  1505. X              if ( ARG_isPOSITIONAL(ad) ) {
  1506. X!                (VOID) get_name( arg_sname(ad), s );
  1507. X                 usrerr("%s required", s);
  1508. X              }
  1509. X              else {
  1510. X  #ifdef amiga_style
  1511. X!                (VOID) get_keyword( arg_sname(ad), s );
  1512. X                 usrerr("argument required for %s keyword", s);
  1513. X  #endif
  1514. X  #ifdef ibm_style
  1515. X!                (VOID) get_name( arg_sname(ad), s );
  1516. X                 {
  1517. X                    char c, *pfx = getenv( "SWITCHAR" );
  1518. X                    c = ( pfx &&  *pfx ) ? *pfx : '/';
  1519. X--- 857,872 ----
  1520. X           if ( ARG_isREQUIRED(ad)  &&  !ARG_isGIVEN(ad) ) {
  1521. X                 /* still didn't get a value... sigh */
  1522. X              if ( ARG_isPOSITIONAL(ad) ) {
  1523. X!                (VOID) get_argname( arg_sname(ad), s );
  1524. X                 usrerr("%s required", s);
  1525. X              }
  1526. X              else {
  1527. X  #ifdef amiga_style
  1528. X!                (VOID) get_kwdname( arg_sname(ad), s );
  1529. X                 usrerr("argument required for %s keyword", s);
  1530. X  #endif
  1531. X  #ifdef ibm_style
  1532. X!                (VOID) get_argname( arg_sname(ad), s );
  1533. X                 {
  1534. X                    char c, *pfx = getenv( "SWITCHAR" );
  1535. X                    c = ( pfx &&  *pfx ) ? *pfx : '/';
  1536. X***************
  1537. X*** 874,884 ****
  1538. X                 }
  1539. X  #endif
  1540. X  #ifdef unix_style
  1541. X!                (VOID) get_name( arg_sname(ad), s );
  1542. X                 usrerr("%s required for %c%c flag", s, c_OPT_PFX, arg_cname(ad));
  1543. X  #endif
  1544. X  #ifdef vms_style
  1545. X!                (VOID) get_keyword( arg_sname(ad), s );
  1546. X                 usrerr("value required for %c%s qualifier", *s_KWD_PFX, s);
  1547. X  #endif
  1548. X              }
  1549. X--- 874,884 ----
  1550. X                 }
  1551. X  #endif
  1552. X  #ifdef unix_style
  1553. X!                (VOID) get_argname( arg_sname(ad), s );
  1554. X                 usrerr("%s required for %c%c flag", s, c_OPT_PFX, arg_cname(ad));
  1555. X  #endif
  1556. X  #ifdef vms_style
  1557. X!                (VOID) get_kwdname( arg_sname(ad), s );
  1558. X                 usrerr("value required for %c%s qualifier", *s_KWD_PFX, s);
  1559. X  #endif
  1560. X              }
  1561. X***************
  1562. X*** 1689,1701 ****
  1563. X              int  *argflags;
  1564. X              BOOL  is_match = FALSE;
  1565. X  
  1566. X!             for (args = argd; !is_match  &&  args; args = cmd_defargs(argd) ) {
  1567. X!                for (ad = ARG_FIRST(args); !ARG_isEND(ad); ARG_ADVANCE(ad) ) {
  1568. X!                   if (arg_type(ad) == argDummy)   continue;
  1569. X                    if ( match(name, arg_sname(ad)) == 0 ) {
  1570. X                       is_match = TRUE;
  1571. X                       break;
  1572. X!                   }
  1573. X                 }/*foreach arg*/
  1574. X              }/*foreach argdesc*/
  1575. X  
  1576. X--- 1689,1702 ----
  1577. X              int  *argflags;
  1578. X              BOOL  is_match = FALSE;
  1579. X  
  1580. X!             for (args = argd ; args  &&  !is_match ; args = cmd_defargs(args)) {
  1581. X!                for (ad = ARG_FIRST(args) ; !ARG_isEND(ad) ; ARG_ADVANCE(ad)) {
  1582. X!                   if ( arg_type(ad) == argDummy )  continue;
  1583. X! 
  1584. X                    if ( match(name, arg_sname(ad)) == 0 ) {
  1585. X                       is_match = TRUE;
  1586. X                       break;
  1587. X!                   }/*if*/
  1588. X                 }/*foreach arg*/
  1589. X              }/*foreach argdesc*/
  1590. X  
  1591. END_OF_FILE
  1592.   if test 50339 -ne `wc -c <'PATCH'`; then
  1593.     echo shar: \"'PATCH'\" unpacked with wrong size!
  1594.   fi
  1595.   # end of 'PATCH'
  1596. fi
  1597. echo shar: End of archive.
  1598. exit 0
  1599. exit 0 # Just in case...
  1600. -- 
  1601. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1602. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1603. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1604. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1605.